package lyo.levelup.rating;

import java.util.HashMap;

public class Player implements Comparable<Player> {
    private int playerID, playerRating;
    String stringName;
    public Player(int playerID, int playerRating, String stringName)
    {
        this.playerID = playerID;
        this.playerRating = playerRating;
        this.stringName = stringName;
        this.stringName = stringName;
    }
    public String getName(){
        return stringName;
    }
    public int getPlayerRating()
    {
        return playerRating;
    }
    public int getPlayerId()
    {
        return playerID;
    }
    @Override
    public int compareTo(Player t) {
        int diff = -(this.getPlayerRating()-t.getPlayerRating());
        if(diff==0){
            diff = this.getPlayerId() - t.getPlayerId();
        }
        return diff;
    }    
    @Override
    public String toString ()
    {
        return "\nUserID: "+playerID+"\n"+"Rating: "+playerRating+"\n"+"UserName";
    }
}